<?php

namespace App\Http\Requests\Admin;

use App\Http\Requests\Request;

class AdminUpdateRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //
            'oldpassword' => 'required',
            'apassword'=>'required',
            'arepassword'=>'required|same:apassword'
        ];
    }

    public function messages()
    {
         return [
            'oldpassword.required'=>'旧密码必填',
            'apassword.required'=>'新密码必填',
            'arepassword.required'=>'确认密码必填',
            'arepassword.same'=>'两次密码不一致'
            ];
    }
}
